home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / DriverSynchronization.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  3.0 KB  |  154 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        DriverSynchronization.h
  3.  
  4.      Contains:    Driver Synchronization Interfaces.
  5.  
  6.      Version:    Technology:    MacOS
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1985-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __DRIVERSYNCHRONIZATION__
  19. #define __DRIVERSYNCHRONIZATION__
  20.  
  21. #ifndef __CONDITIONALMACROS__
  22. #include <ConditionalMacros.h>
  23. #endif
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27.  
  28.  
  29.  
  30. #if PRAGMA_ONCE
  31. #pragma once
  32. #endif
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37.  
  38. #if PRAGMA_IMPORT
  39. #pragma import on
  40. #endif
  41.  
  42. #if PRAGMA_STRUCT_ALIGN
  43.     #pragma options align=mac68k
  44. #elif PRAGMA_STRUCT_PACKPUSH
  45.     #pragma pack(push, 2)
  46. #elif PRAGMA_STRUCT_PACK
  47.     #pragma pack(2)
  48. #endif
  49.  
  50. EXTERN_API_C( void )
  51. SynchronizeIO                    (void)                                                        ONEWORDINLINE(0x4E71);
  52.  
  53. EXTERN_API_C( Boolean )
  54. CompareAndSwap                    (UInt32                 oldVvalue,
  55.                                  UInt32                 newValue,
  56.                                  UInt32 *                OldValueAdr);
  57.  
  58. EXTERN_API_C( Boolean )
  59. TestAndClear                    (UInt32                 bit,
  60.                                  UInt8 *                startAddress);
  61.  
  62. EXTERN_API_C( Boolean )
  63. TestAndSet                        (UInt32                 bit,
  64.                                  UInt8 *                startAddress);
  65.  
  66. EXTERN_API_C( SInt8 )
  67. IncrementAtomic8                (SInt8 *                value);
  68.  
  69. EXTERN_API_C( SInt8 )
  70. DecrementAtomic8                (SInt8 *                value);
  71.  
  72. EXTERN_API_C( SInt8 )
  73. AddAtomic8                        (SInt32                 amount,
  74.                                  SInt8 *                value);
  75.  
  76. EXTERN_API_C( UInt8 )
  77. BitAndAtomic8                    (UInt32                 mask,
  78.                                  UInt8 *                value);
  79.  
  80. EXTERN_API_C( UInt8 )
  81. BitOrAtomic8                    (UInt32                 mask,
  82.                                  UInt8 *                value);
  83.  
  84. EXTERN_API_C( UInt8 )
  85. BitXorAtomic8                    (UInt32                 mask,
  86.                                  UInt8 *                value);
  87.  
  88. EXTERN_API_C( SInt16 )
  89. IncrementAtomic16                (SInt16 *                value);
  90.  
  91. EXTERN_API_C( SInt16 )
  92. DecrementAtomic16                (SInt16 *                value);
  93.  
  94. EXTERN_API_C( SInt16 )
  95. AddAtomic16                        (SInt32                 amount,
  96.                                  SInt16 *                value);
  97.  
  98. EXTERN_API_C( UInt16 )
  99. BitAndAtomic16                    (UInt32                 mask,
  100.                                  UInt16 *                value);
  101.  
  102. EXTERN_API_C( UInt16 )
  103. BitOrAtomic16                    (UInt32                 mask,
  104.                                  UInt16 *                value);
  105.  
  106. EXTERN_API_C( UInt16 )
  107. BitXorAtomic16                    (UInt32                 mask,
  108.                                  UInt16 *                value);
  109.  
  110. EXTERN_API_C( SInt32 )
  111. IncrementAtomic                    (SInt32 *                value);
  112.  
  113. EXTERN_API_C( SInt32 )
  114. DecrementAtomic                    (SInt32 *                value);
  115.  
  116. EXTERN_API_C( SInt32 )
  117. AddAtomic                        (SInt32                 amount,
  118.                                  SInt32 *                value);
  119.  
  120. EXTERN_API_C( UInt32 )
  121. BitAndAtomic                    (UInt32                 mask,
  122.                                  UInt32 *                value);
  123.  
  124. EXTERN_API_C( UInt32 )
  125. BitOrAtomic                        (UInt32                 mask,
  126.                                  UInt32 *                value);
  127.  
  128. EXTERN_API_C( UInt32 )
  129. BitXorAtomic                    (UInt32                 mask,
  130.                                  UInt32 *                value);
  131.  
  132.  
  133.  
  134. #if PRAGMA_STRUCT_ALIGN
  135.     #pragma options align=reset
  136. #elif PRAGMA_STRUCT_PACKPUSH
  137.     #pragma pack(pop)
  138. #elif PRAGMA_STRUCT_PACK
  139.     #pragma pack()
  140. #endif
  141.  
  142. #ifdef PRAGMA_IMPORT_OFF
  143. #pragma import off
  144. #elif PRAGMA_IMPORT
  145. #pragma import reset
  146. #endif
  147.  
  148. #ifdef __cplusplus
  149. }
  150. #endif
  151.  
  152. #endif /* __DRIVERSYNCHRONIZATION__ */
  153.  
  154.